<T:ViewBase x:Class="WPFExcelReport.TQP12"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    Name="TV"
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/> 
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>  
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Background="{StaticResource QueryZoneBrush}">
            <WrapPanel> 
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >查询</TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <me:TSQP12  Grid.Column="1" KEY="{Binding MERKM,ElementName=TV}"/>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        
                     </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" >项目</TextBlock>
                    <ex:TXT72 MaxLength="4"  Grid.Column="1"  FontSize="18" Foreground="Red"   Text="{Binding ART}" Width="80"/>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=执行标准:}}"></TextBlock>
                    <ex:TXT72 MaxLength="15" Grid.Column="1" CharacterCasing="Upper" Text="{Binding NORM}" Width="100" />
                    <SD:K0477   Grid.Column="2"   
                                       KEY="{Binding NORM,ElementName=TV}" 
                                       Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=说明:}}"></TextBlock> 
                    <ex:TXT72 MaxLength="50" Grid.Column="1" CharacterCasing="Upper" Text="{Binding DES}" Width="240" />
                 </Grid>
                
            </WrapPanel>
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0" BorderBrush="{StaticResource BorderBrush}">
            <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=QPMMERKM}" Header="{Binding Source={Localization:Translate Word=项目}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMKURZB, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMBEZ, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=计算公式}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMNUMKZ}" Header="{Binding Source={Localization:Translate Word=数值型}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMNORM}" Header="{Binding Source={Localization:Translate Word=分组}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMVERS }" Header="{Binding Source={Localization:Translate Word=目标值}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMWERTV}" Header="{Binding Source={Localization:Translate Word=最小值}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMWERTB}" Header="{Binding Source={Localization:Translate Word=最大值}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMMEEH}" Header="{Binding Source={Localization:Translate Word=单位}}"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=QPMAENB}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMAEND}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMNEUB}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QPMNEUD}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </Border>
    </Grid>
</T:ViewBase>
